package com.zhuang.designpattern.visitor.user.impl;

import com.zhuang.designpattern.visitor.visitor.Visitor;
import com.zhuang.designpattern.visitor.user.User;
import java.math.BigDecimal;

/**
 * description: Teacher
 * date: 2022/9/22 17:13
 * author: Zhuang
 * version: 1.0
 */
public class Teacher extends User {
    public Teacher(String name, String identity, String clazz) {
        super(name, identity, clazz);
    }
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
    // 升本率
    public double entranceRatio() {
        return BigDecimal.valueOf(Math.random() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
    }

}
